/*
 * Copyright (C) 2019 Baidu, Inc. All Rights Reserved.
 */
package com.bootdo.hjh.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.bootdo.hjh.domain.StockDO;

/**
 * 库存变更记录
 *
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2019-04-08 15:26:46
 */
public interface StockService {

	StockDO get(Integer id);

	List<StockDO> list(Map<String, Object> map);

	int count(Map<String, Object> map);

	int save(StockDO stock);

	int update(StockDO stock);

	int remove(Integer id);

	int batchRemove(Integer[] ids);

	/**
	 * 我的剩余库存
	 * @param userId 用户ID
	 * @param productType 1-杜小栗， 2-黑莓
	 * @return
	 */
	Integer myStockBalance(Long userId, Integer productType);

	List<StockDO> listStocks(Long userId, Integer type, Date beginDate, Date endDate, Integer offset,
							 Integer limit);

	Integer countStocks(Long userId, Integer type, Date beginDate, Date endDate);

	int sumStocks(Long userId, Integer type, Date beginDate, Date endDate);
}
